---@class FighterStateEnum
---@field is fun(number,number):boolean
FighterStateEnum = ClientFight.CreateClass("FighterStateEnum")

function FighterStateEnum:ctor(state)
    self.state = state
end
function FighterStateEnum:getState()
    return self.state
end
addOverload(FighterStateEnum,"is",
        function(states,state)
            return bit.band(states,state) > 0
        end,"number","number")
addOverload(FighterStateEnum,"is",
function(fighter,stateEnum)
    return FighterStateEnum.is(fighter.totalState.state,stateEnum:getState())
end,"table","table")
addOverload(FighterStateEnum,"is",
        function(states,stateEnum)
            return FighterStateEnum.is(states,stateEnum:getState())
        end,"number","table")

FighterStateEnum.CAN_NOT_MOVE = FighterStateEnum.New(1)       --1不能移动
FighterStateEnum.CAN_NOT_USE_SKILL = FighterStateEnum.New(2)      -- 2不能使用技能
FighterStateEnum.CAN_NOT_NORMAL_ATTACK = FighterStateEnum.New(2^2) --3不能普通攻击
FighterStateEnum.IMMUNITY_BALLISTIC = FighterStateEnum.New(2^3)   --4免疫弹道伤害
FighterStateEnum.IMMUNITY = FighterStateEnum.New(2^4)             --5免疫全部伤害
FighterStateEnum.CAN_NOT_SELECT_BY_ENEMY = FighterStateEnum.New(2^5)--6不可被敌人选中
FighterStateEnum.CAN_NOT_SELECT_BY_FRIENDLY = FighterStateEnum.New(2^6)--7不可被友军选中
FighterStateEnum.CAN_NOT_DAMAGE_BY_ENEMY = FighterStateEnum.New(2^7)  --8不可被敌人伤害选中
FighterStateEnum.CAN_NOT_DAMAGE_BY_FRIENDLY = FighterStateEnum.New(2^8)   --9不可被友军伤害选中
FighterStateEnum.CHARM = FighterStateEnum.New(2^9)                        --10魅惑
FighterStateEnum.IMMUNITY_PHYSICAL_DAMAGE = FighterStateEnum.New(2^10)    --11免疫物理伤害
FighterStateEnum.IMMUNITY_MAGIC_DAMAGE = FighterStateEnum.New(2^11)       --12免疫魔法伤害
FighterStateEnum.BLIND_NORMAL_ATTACK = FighterStateEnum.New(2^12)         --13普攻致盲
FighterStateEnum.BLIND_SKILL_ATTACK = FighterStateEnum.New(2^13)          --14技能致盲
FighterStateEnum.BAN_HEAL = FighterStateEnum.New(2^14)                    --15禁疗（治疗）
FighterStateEnum.BAN_SUCK_BLOOD = FighterStateEnum.New(2^15)              --16禁疗（吸血）
FighterStateEnum.MUST_CRITICAL = FighterStateEnum.New(2^16)               --17必定暴击
FighterStateEnum.LOCK_HP = FighterStateEnum.New(2^17)                     --18锁血
FighterStateEnum.MOVE_TO_POINT = FighterStateEnum.New(2^18)               --19移动到指定地点（没有目标）
FighterStateEnum.ATTRACT_NORMAL_BULLET = FighterStateEnum.New(2^19)       --20吸引普攻子弹
FighterStateEnum.IMMUNITY_DEBUFF = FighterStateEnum.New(2^20)             --21免疫debuff
FighterStateEnum.IMMUNITY_BENEFICIAL_BUFF = FighterStateEnum.New(2^21)    --22免疫增益buff
FighterStateEnum.MUST_BE_HIT = FighterStateEnum.New(2^22)                 -- 23 必定被命中
FighterStateEnum.CAN_NOT_SELECT_BY_NORMAL_ATTACK = FighterStateEnum.New(2^23)-- 24 不能被敌人普攻选中
